<?php
/*
 * Copyright (c) 2011 Todd Brady
 *
 * PS3Theatre is freely distributable under the terms of the MIT license.
 * For details, see the MIT-Licence web site: http://www.opensource.org/licenses/mit-license.php 
 */
 
	include_once("../includes/db_connect.php");
 
	$tmdbQuery = "SELECT tmdb_id from tbl_movies where tmdb_id != -1";
	$tmdbResult=mysql_query($tmdbQuery);
	$random = rand(1,mysql_num_rows($tmdbResult));
	$i = 0;
	
	while($i < $random){
		$tmdbArray = mysql_fetch_array($tmdbResult);
		$i++;
	}

	//redirect to get images for tmdb id
	header( 'Location: movieImport.php?movieId='.$tmdbArray['tmdb_id'].'&backdrop=Y');